<template>

      <div class="aa">
      <div v-for="(item,index) in list2" :key="index" 
      @click="onClickSuoyouList(item)"
      class="asd">
          <div class="aasdg">
              <img :src="item.icon" alt="">
          </div>
          <div>
              {{item.name}}
          </div>
      </div>
  </div>
</template>

<script>
export default {
    data(){
        return{
            list2:JSON.parse(localStorage.getItem("peishi")) || [],
        }
    },
    mounted(){
        // console.log(this.$route.query.item);
        this.list2 = this.$route.query.item
        console.log(this.list2);
    },
        methods:{
        onClickSuoyouList(item){
            this.$router.push({
                path:"/searchlist",
                query:{
                    id:item.id
                }
            })
        }
    }
}
</script>

<style>
.aasdg
{
    width: 100%;
}
.aasdg img
{
    width: 100%;
}
.asd
{
    width: 25%;
    height:5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.5rem;
}
.aa
{
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}
</style>